package com.aier.mapper.inventory;

import com.aier.bean.inventory.InventoryBean;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


@Mapper
public interface InventoryMapper extends BaseMapper<InventoryBean> {
    /**
     * 获取所有商品的库存信息
     * @return
     */
    List<InventoryBean> getAllInventoryInfo();


    /**
     * 根据商品型号获取商品的的库存
     * @param modeName
     * @return
     */
    List<InventoryBean> getAllInventoryInfoByModelName(@Param("modelName") String modeName);

    /**
     * 获取所有的型号列表
     * @return
     */
    List<String> getAllModeName();

    /**
     * 修改业务员姓名
     */
    int updateSalespersonByModelNameAndOldSalesperson(@Param("modelName") String modelName, @Param("oldSalesperson") String oldSalesperson, @Param("newSalesperson") String newSalesperson);


    /**
     * 获取所有业务员姓名
     * @return
     */
    List<String> getAllSalespersonName();

    /**
     * 获取所有业务员姓名
     * @return
     */
    List<InventoryBean> getInventoryListByModelNameAndSalesperson(@Param("modelName") String modelName, @Param("salesperson")String salesperson);


    void insertSku(@Param("modelName") String modelName,@Param("sku") String sku);

}
